def bytes_to_int(bytes_in, oder=r'ELFDATA2LSB'):
    result = 0
    if oder == r'ELFDATA2LSB' and bytes_in:
        for b in bytes_in[::-1]:
            result = result * 256 + int(b)
        return result
    else:
        return None


def int_to_bytes(value, length, oder=r'ELFDATA2LSB'):
    result = []
    if oder == r'ELFDATA2LSB' and value != None and length != 0:
        for i in range(0, length):
            result.append(value >> (i * 8) & 0xff)
        return result[::-1]
    else:
        return None
